public class synchronizedTest3 implements Runnable {
    //共享资源
    static int i = 0;

    /**
     * synchronized 修饰静态方法
     */
    public static synchronized void increase() {
        i++;
    }

    @Override
    public void run() {
        for (int j = 0; j < 10000; j++) {
            increase();
        }
    }
}
